import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'webSite',
      component: () => import('@/layout/index.vue'),
      redirect: '/home',
      //配置children 属性，用于配置子路由 不能起同级的路由 除非是单独的界面
      children: [
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/HomeView.vue'),
          meta: {
            title: '数据中心',
            isHide: true,
            isAffix: true,
          },
        },
        {
          path: 'about',
          name: 'about',
          component: () => import('@/views/AboutView.vue'),
          meta: {
            title: '数据列表',
            isHide: true,
            isAffix: true,
          },
        },
      ],
    },
  ],
})

export default router
